import pika

credentials = pika.PlainCredentials("guest", "guest")
conn_params = pika.ConnectionParameters("localhost",credentials=credentials)
conn_broker = pika.BlockingConnection(conn_params)
channel = conn_broker.channel()

channel.exchange_declare(exchange="durable-exchange", 
                         exchange_type="direct",
                         passive=False,
                         durable=True,
                         auto_delete=False)

channel.queue_declare(queue="hello-queue")

channel.queue_bind(queue="hello-queue", 
                   exchange="durable-exchange",
                   routing_key="hola")

channel.basic_publish(body="message",
                      exchange="durable-exchange",
                      routing_key="hola")
